package com.flurry.android;

import android.util.Log;
import com.flurry.android.responses.AppCloudEnumSearchResultCompletionHandler;
import com.flurry.android.responses.AppCloudSearchResultCompletionHandler;
import java.util.LinkedList;
import java.util.concurrent.ExecutorService;

public class AppCloudSearch
{
  private CacheSearchItemsData bA = null;
  private CacheSearchData bz = null;
  private ExecutorService eD = null;
  private LinkedList<AppCloudSearchPredicateMatch> gx = null;
  private AppCloudSearchPredicateReturnOrder gy = null;
  private AppCloudSearchPredicatePaginationOrLimit gz = null;
  private String mCollectionName = null;

  AppCloudSearch()
  {
  }

  AppCloudSearch(String paramString)
  {
    this.mCollectionName = paramString;
  }

  private void a(int paramInt1, int paramInt2, AppCloudEnumSearchResultCompletionHandler paramAppCloudEnumSearchResultCompletionHandler, boolean paramBoolean)
  {
    setPaginatingOrLimit(AppCloudSearchPaginatingOrLimitPredicateCreator.preginateResult(paramInt1, paramInt2));
    searchWithCompletionHandler(new ey(this, paramAppCloudEnumSearchResultCompletionHandler, paramInt2, paramInt1, paramBoolean));
  }

  public static void onMakeSearchNotValidForCollection(String paramString)
  {
    CacheSearchData localCacheSearchData = (CacheSearchData)FlurryAppCloud.a(gn.iL);
    CacheSearchItemsData localCacheSearchItemsData = (CacheSearchItemsData)FlurryAppCloud.a(gn.iM);
    if ((localCacheSearchData != null) && (localCacheSearchData != null))
    {
      Object[] arrayOfObject = localCacheSearchData.getIdsAssociatedWithCollectionName(paramString);
      localCacheSearchData.removeByCollectionName(paramString);
      for (int i = 0; i < arrayOfObject.length; i++)
        localCacheSearchItemsData.removeItemsById((String)arrayOfObject[i]);
    }
  }

  public static void toStringAndPrint()
  {
    Log.i("SearchCache", "============SEARCH REQUESTS==================");
    ((CacheSearchData)FlurryAppCloud.a(gn.iL)).readAll();
    Log.i("SearchCache", "============SEARCH ITEMS==================");
    ((CacheSearchItemsData)FlurryAppCloud.a(gn.iM)).readAll();
  }

  public void addPredicate(AppCloudSearchPredicateMatch paramAppCloudSearchPredicateMatch)
  {
    if (this.gx == null)
      this.gx = new LinkedList();
    this.gx.add(paramAppCloudSearchPredicateMatch);
  }

  public void searchWithCompletionHandler(AppCloudSearchResultCompletionHandler paramAppCloudSearchResultCompletionHandler)
  {
    this.eD.execute(new eq(this, paramAppCloudSearchResultCompletionHandler));
  }

  public void searchWithFetchBatchSize(int paramInt1, int paramInt2, AppCloudEnumSearchResultCompletionHandler paramAppCloudEnumSearchResultCompletionHandler)
  {
    a(paramInt1, paramInt2, paramAppCloudEnumSearchResultCompletionHandler, false);
  }

  public void setOrder(AppCloudSearchPredicateReturnOrder paramAppCloudSearchPredicateReturnOrder)
  {
    this.gy = paramAppCloudSearchPredicateReturnOrder;
  }

  public void setPaginatingOrLimit(AppCloudSearchPredicatePaginationOrLimit paramAppCloudSearchPredicatePaginationOrLimit)
  {
    this.gz = paramAppCloudSearchPredicatePaginationOrLimit;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.flurry.android.AppCloudSearch
 * JD-Core Version:    0.6.2
 */